package com.zl.autocode.controller.autocode;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.zl.autocode.controller.base.AutocodeBaseController;
import com.zl.autocode.dto.autocode.cfgGenerateDtl.ReqCfgGenerateDtlAddDTO;
import com.zl.autocode.dto.autocode.cfgGenerateDtl.ReqCfgGenerateDtlDelDTO;
import com.zl.autocode.dto.autocode.cfgGenerateDtl.ReqCfgGenerateDtlDetailDTO;
import com.zl.autocode.dto.autocode.cfgGenerateDtl.ReqCfgGenerateDtlEditDTO;
import com.zl.autocode.dto.autocode.cfgGenerateDtl.ReqCfgGenerateDtlQueryDTO;
import com.zl.autocode.dto.autocode.cfgGenerateDtl.ReqCfgGenerateDtlStateDTO;
import com.zl.autocode.dto.autocode.cfgGenerateDtl.ResCfgGenerateDtlAddDTO;
import com.zl.autocode.dto.autocode.cfgGenerateDtl.ResCfgGenerateDtlDelDTO;
import com.zl.autocode.dto.autocode.cfgGenerateDtl.ResCfgGenerateDtlDetailDTO;
import com.zl.autocode.dto.autocode.cfgGenerateDtl.ResCfgGenerateDtlEditDTO;
import com.zl.autocode.dto.autocode.cfgGenerateDtl.ResCfgGenerateDtlQueryDTO;
import com.zl.autocode.dto.autocode.cfgGenerateDtl.ResCfgGenerateDtlStateDTO;
import com.zl.autocode.service.autocode.ICfgGenerateDtlService;
import com.zl.common.dto.ReqDTO;
import com.zl.common.dto.ResDTO;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 代码生成配置明细
 * @author ZL
 */
@Api(value="代码生成配置明细",tags ="代码生成配置明细")
@RestController("autocodeCfgGenerateDtlController")
@RequestMapping("/autocode/cfgGenerateDtl")
public class CfgGenerateDtlController extends AutocodeBaseController {

    @Autowired
    private ICfgGenerateDtlService cfgGenerateDtlService;
    
    /**
     * 查询
     */
    @ApiOperation(value="代码生成配置明细-查询")
    @RequestMapping(value="/list", method = RequestMethod.POST)
    public ResDTO<ResCfgGenerateDtlQueryDTO> listCfgGenerateDtl(@RequestBody ReqDTO<ReqCfgGenerateDtlQueryDTO> reqInfo) throws Exception{
        ResCfgGenerateDtlQueryDTO data = cfgGenerateDtlService.queryCfgGenerateDtlList(reqInfo);
        return successDATA(data);
    }
    
   /**
     * 详情
     */
    @ApiOperation(value="代码生成配置明细-详情")
    @RequestMapping(value="/detail", method = RequestMethod.POST)
    public ResDTO<ResCfgGenerateDtlDetailDTO> detailCfgGenerateDtl(@RequestBody ReqDTO<ReqCfgGenerateDtlDetailDTO> reqInfo) throws Exception{
        ResCfgGenerateDtlDetailDTO data = cfgGenerateDtlService.queryCfgGenerateDtlDetail(reqInfo);
        return successDATA(data);
    }
    
    /**
     * 新增
     */
    @ApiOperation(value="代码生成配置明细-新增")
    @RequestMapping(value="/add", method = RequestMethod.POST)
        public ResDTO<ResCfgGenerateDtlAddDTO> addCfgGenerateDtl(@RequestBody ReqDTO<ReqCfgGenerateDtlAddDTO> reqInfo) throws Exception{
        ResCfgGenerateDtlAddDTO data = cfgGenerateDtlService.insertCfgGenerateDtlInfo(reqInfo);
        return successDATA(data);
    }
    
    /**
     * 编辑
     */
    @ApiOperation(value="代码生成配置明细-编辑")
    @RequestMapping(value="/edit", method = RequestMethod.POST)
        public ResDTO<ResCfgGenerateDtlEditDTO> editCfgGenerateDtl(@RequestBody ReqDTO<ReqCfgGenerateDtlEditDTO> reqInfo) throws Exception{
        ResCfgGenerateDtlEditDTO data = cfgGenerateDtlService.updateCfgGenerateDtlInfo(reqInfo);
        return successDATA(data);
    }
    
    /**
     * 删除
     */
    @ApiOperation(value="代码生成配置明细-删除")
    @RequestMapping(value="/del", method = RequestMethod.POST)
        public ResDTO<ResCfgGenerateDtlDelDTO> delCfgGenerateDtl(@RequestBody ReqDTO<ReqCfgGenerateDtlDelDTO> reqInfo) throws Exception{
        ResCfgGenerateDtlDelDTO data = cfgGenerateDtlService.deleteCfgGenerateDtlInfo(reqInfo);
        return successDATA(data); 
    }
    
    /**
     * 状态更新
     */
    @ApiOperation(value="代码生成配置明细-状态更新")
    @RequestMapping(value="/state", method = RequestMethod.POST)
        public ResDTO<ResCfgGenerateDtlStateDTO> stateCfgGenerateDtl(@RequestBody ReqDTO<ReqCfgGenerateDtlStateDTO> reqInfo) throws Exception{
        ResCfgGenerateDtlStateDTO data = cfgGenerateDtlService.updateCfgGenerateDtlState(reqInfo);
        return successDATA(data); 
    }
    
    
}